﻿<%@ Page Language="C#" MasterPageFile="Site.master" AutoEventWireup="true" CodeBehind="upload.aspx.cs"
    Inherits="GeniusWebApplication.upload" %>

<asp:Content ID="_css_place" ContentPlaceHolderID="css_place" runat="server">
    <link href="./css/upload.css" rel="stylesheet" type="text/css">
</asp:Content>
<asp:Content ID="_upload" ContentPlaceHolderID="upload" runat="server">
</asp:Content>
<asp:Content ID="_library" ContentPlaceHolderID="library" runat="server">
    <span onmouseover="overZui(this);" onclick="clickNav(this);">普通上传</span> <span onmouseover="overZui(this);"
        onclick="clickNav2(this);">大文件上传</span>
    <script>
        filetype = "normal";
        function overZui(l) {
            var a = document.getElementById("zuixinSelected");
            var length_l = getElementLeft(l) - 29;
            a.style.left = length_l + "px";
        }
        function clickNav(l) {
            var a = document.getElementById("zuixinSelected0");
            var length_l = getElementLeft(l) - 29;
            a.style.left = length_l + "px";
            filetype = "normal";
            $("#bigFileFrame").hide(500);
        }
        function clickNav2(l) {
            var a = document.getElementById("zuixinSelected0");
            var length_l = getElementLeft(l) - 29;
            a.style.left = length_l + "px";
            filetype = "big";
            $("#bigFileFrame").show(500);
        }
        function analyzeKeywords() {
            var resourceName = $("#float_left_t_resourceName").val().trim();
            var description = $("#float_left_t_resourceDescription").val().trim();
            if (resourceName == "" || description == "")
                return;
            $.ajax({
                type: "POST",
                url: "upload.aspx/analyzeKeywords",
                data: "{resourceName:'" + resourceName + "',description:'" + description + "'}",
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    $("#float_left_t_keywords").val(data.d);
                }
            });
        }
        function checkFileType() {
            if (filetype == "big") {
                var fileName = $("#fileFrame", parent.document.body).contents().find("#fileName").val();
                if (fileName == null || fileName == "") {
                    alert("请先上传文件");
                    return false;
                }
                $("#float_left_hf_resourceFileName").val(fileName);
            } else {
                $("#float_left_hf_resourceFileName").val("");
                return true;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="_you_shang_jiao" ContentPlaceHolderID="you_shang_jiao" runat="server">
    <input type="search" placeholder="搜索资源" results="8" id="searchBox" name="searchBox">
    <select id="searchType">
        <option value="0">普通搜索</option>
        <option value="1">高级搜索</option>
    </select>
    <span class="headerItem"><a href="#" onclick="searchResource();">搜索</a></span> <span
        class="headerItem" id="message_notice">消息</span> <span class="headerItem"><a href="./log.aspx">
            退出</a></span>
</asp:Content>
<asp:Content ID="_float_left" ContentPlaceHolderID="float_left" runat="server">
    <section id="myList">
    <div id="bigFileFrame" style="display:none;"><iframe id="fileFrame" name="fileFrame" src="UpLoadTestPage.aspx" width="100%"></iframe></div>
			<form id="uploadform" name="uploadform" action="" method="POST" runat="server" >
			<!-- left upload -->
			<div class="bor_box_1 upload_left" runat="server" >
				<table border="0" cellspacing="0" cellpadding="0" class="upload" >
				<tr>
				    <td>
					    <dl class="note_upload">
					    <dt  runat="server" >
                            <asp:FileUpload ID="FileUpload1" runat="server" /><asp:Label ID="l_resourceFile" runat="server"></asp:Label>
                        </dt>
					
					    </dl>
				    </td>
				
				</tr>
				<tr>
				<th>资源名称：<asp:HiddenField ID="hf_resourceFileName" runat="server" /></th>
				<td><asp:TextBox ID="t_resourceName" runat="server"></asp:TextBox></td>
				</tr>
				<tr>
				<th>&nbsp;</th>
				<td class="gray_1">不小于5个汉字或10个字母，详细的标题容易被下载。</td>
				</tr>
				<tr>
				<th>资源类型：</th>
				<td>
					<div style="margin:10px 0 10px 0;" id="categoryList"></div>
                    <asp:DropDownList id="dd_resourceType" runat="server">
                    </asp:DropDownList>
				</td>
				</tr>
                <tr>
				<th>可下载部门：</th>
				<td>
                    <div style="margin:10px 0 10px 0;" id="departmentList"></div>
                    <asp:DropDownList id="dd_department" runat="server">
                    </asp:DropDownList>
                </td>
				</tr>
				
				<tr>
				<th valign="top">资源描述：</th>
				<td><asp:TextBox ID="t_resourceDescription" runat="server" TextMode="MultiLine"></asp:TextBox></td>
				</tr>
				
				<tr>
				<th>关键词：</th>
				<td><asp:TextBox ID="t_keywords" runat="server"></asp:TextBox><input type="button" value="自动提取" onclick="analyzeKeywords();" /></td>
				</tr>
				<tr>
				<th>&nbsp;</th>
				<td class="gray_1">多个关键字请用半角逗号","分隔，最多填写10个。</td>
				</tr>
				
				<tr>
				<th>&nbsp;</th>
				<td>
                    <asp:Button ID="bt_upload" runat="server" onclick="ButtonUpload_Click" Text="上传资源" />           
                </td>
				</tr>
				
                </table>
			</div>
			<!-- upload need to know -->
			
			</form>
		
		</section>
</asp:Content>
<asp:Content ID="_float_right" ContentPlaceHolderID="float_right" runat="server">
    <div id="doc">
        <div id="xinxi">
            我的上传</div>
        <div id="con" runat="server">
        </div>
    </div>
    <div id="keywords">
        <div id="guanjian">
            标签</div>
        <div id="keys" runat="server">
        </div>
    </div>
    <div id="stopFlow">
    </div>
</asp:Content>
